<?php

$path = 'D:/www/smit/';

$excluded = array('dev', 'components', 'geshi', 'decoda', 'styles', 'assets');
$i = 0;
$files = array();

function replace($dir = '')
{
	global $excluded, $i, $files;

	$iterator = new DirectoryIterator($dir);
	foreach ($iterator as $fileinfo) {
		$ext = strtolower(strrchr($fileinfo->getFilename(), '.'));
		if (!$fileinfo->isDot() && ($ext == '.php' || $ext == '')) {
			//echo $iterator->getPath() . '/' . $fileinfo->getFilename() . chr(10);
			switch($iterator->getType())
			{
				case 'file':
					$contents = file_get_contents($iterator->getPath() . '/' . $fileinfo->getFilename());
					if(stristr($contents, 'hih'))
					{
						$i++;
						$files[] = $iterator->getPath() . '/' . $fileinfo->getFilename();
					}
				break;
				case 'dir':
					replace($iterator->getPath() . '/' . $fileinfo->getFilename() . '/');
				break;
			}
		}
	}
}

replace($path);

echo
'
-------------------------------------------------------
	Found '.$i.' Files
	
	The Files are listed for Clarification
	'.implode("\n\t", $files).'
-------------------------------------------------------
';
?>